import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { BrowserRouter } from "react-router-dom";
import { Provider } from "react-redux";
import { ConfigProvider } from "antd";
import { I18nextProvider } from "react-i18next";
import i18n from "@/i18n";
import { store } from "@/stores";
import App from "./App";
import "antd/dist/reset.css"; // 引入Antd重置样式
import React from "react";
import { GlobalLoadingProvider } from "./common/GlobalLoading";

const container = document.getElementById("root")!;
const root = createRoot(container);
const theme = {
  token: {
    colorPrimary: "#4a3c8c", // 主按钮颜色（如 Primary 类型）
    colorSuccess: "#2ecc71", // Success 按钮颜色
    colorWarning: "#f39c12", // Warning 按钮颜色
    colorError: "#e74c3c", // Danger 按钮颜色
    colorInfo: "#3498db", // Info 按钮颜色
  },
  components: {
    Button: {
      colorPrimaryHover: "#5d4eb3", // 主按钮悬停色
    },
  },
};

root.render(
  // <React.StrictMode>
  <Provider store={store}>
    <I18nextProvider i18n={i18n}>
      <ConfigProvider prefixCls="ant" theme={theme}>
        <BrowserRouter>
          <GlobalLoadingProvider>
            <App />
          </GlobalLoadingProvider>
        </BrowserRouter>
      </ConfigProvider>
    </I18nextProvider>
  </Provider>
  // </React.StrictMode>
);
